package com.aba.bms.lend;


import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.*;
 
public class LibrarySystem {
 
    public static void main(String[] args) {
        LibraryManager manager = new LibraryManager();
        Scanner scanner = new Scanner(System.in);
 
        while (true) {
            System.out.println("\n==== 图书管理系统 ====");
            System.out.println("1. 借阅图书");
            System.out.println("2. 归还图书");
            System.out.println("3. 查询记录");
            System.out.println("4. 退出系统");
            System.out.print("请选择操作：");
 
            int choice = scanner.nextInt();
            switch (choice) {
                case 1:
                    System.out.print("输入用户ID: ");
                    long userId = scanner.nextLong();
                    System.out.print("输入图书ID: ");
                    long bookId = scanner.nextLong();
                    manager.borrowBook(userId, bookId);
                    break;
                case 2:
                    System.out.print("输入借阅记录ID: ");
                    long recordId = scanner.nextLong();
                    manager.returnBook(recordId);
                    break;
                case 3:
                    System.out.print("输入用户ID（0查询全部）: ");
                    long queryUserId = scanner.nextLong();
                    manager.showRecords(queryUserId);
                    break;
                case 4:
                    System.out.println("系统已退出");
                    return;
                default:
                    System.out.println("无效选择");
            }
        }
    }
}
 